﻿namespace WatiN.Extensions
{
    using global::WatiN.Core;

    public static class LabelCollectionExtensions
    {
        public static bool Exists(this LabelCollection labelCollection, string labelIdOrNameOrValueorClass, bool extension = true)
        {
            return labelCollection.Exists(Find.ById(labelIdOrNameOrValueorClass)) ||
                labelCollection.Exists(Find.ByName(labelIdOrNameOrValueorClass)) ||
                labelCollection.Exists(Find.ByValue(labelIdOrNameOrValueorClass)) ||
                labelCollection.Exists(Find.ByClass(labelIdOrNameOrValueorClass)) ||
                labelCollection.Exists(Find.ByLabelText(labelIdOrNameOrValueorClass));
        }
    }
}